<template>
	<view>
		<view class="header" :class="scroll == true ? 'scrollStyle' : ''">
			<view class="logo">
				<image src="../../static/logo.png" mode="widthFix"></image>
			</view>
			<view class="text">
				<view class="t02">{{urldata}}</view>
			</view>
			<view class="copy" @tap="copyMoneyUrl">复制</view>
			<!-- <view class="bsc_box">
				<picker @change="choiceBsc" :value="bscIndex" :range="bscData" :range-key="'name'">
					<view class="bsc_auto">
						<view class="bsci">
							<image src="../../static/logo02.png" mode="widthFix"></image>
						</view>
						<view class="bsc">{{bscText}}</view>
					</view>
				</picker>
			</view> -->
			<view class="lang">
				<picker @change="choiceLang" :value="langIndex" :range="langData" :range-key="'name'">
					<image src="../../static/lang.png" mode="widthFix"></image>
				</picker>
			</view>
			<view class="more" @tap="autoListPage">
				<image src="../../static/more.png" mode="widthFix"></image>
			</view>
			<!-- <view class="signin" @tap="autoSignin" v-if="!login">登錄</view>
			<view class="signin02" v-if="login">
				<image src="../../static/login.png" mode="widthFix"></image>
			</view> -->
		</view>
		

		<view class="nav_pupu" v-if="pupu">
			<view class="nav_box" :class="pupu == false ? 'nav_index' : ''">
				<view class="close iconfont" @tap="autoListPage">&#xe608;</view>
				<view class="nav_list">
					<block v-for="(item, index) in navlist" :key="index">
						<view class="list" :data-url="item.url" @click="gotopage">
							<view class="icon">
								<image :src="item.img" mode="widthFix"></image>
							</view>
							<view class="name">{{ item.name }}</view>
							<view class="arrow iconfont">&#xe601;</view>
						</view>
					</block>
				</view>
			</view>
		</view>

		<view class="pupu_box" v-if="login">
			<view class="pupu_show" @tap.stop="">
				<view class="title">登录授权</view>
				<view class="text">钱包ID</view>
				<view class="input"><input type="" name="" value="" placeholder="请输入钱包ID" /></view>
				<view class="text">邀请码</view>
				<view class="input"><input type="" name="" value="" placeholder="请输入您的邀请码" /></view>
				<view class="menu_box">
					<view class="menu" @tap="autoSignin">取消</view>
					<view class="menu">确定</view>
				</view>
			</view>
		</view>
		<view class="clear_box"></view>

		<view class="content_box">
			
			<block v-for="(item, index) in 7" :key="index">
				<view class="list_box">
					<view class="zuob">
						<view class="img"><image src="../../static/icons/icon01.png" mode="widthFix"></image></view>
						<view>
							<view class="name">收益</view>
							<view class="time">2022-12-22 13:32:19</view>
						</view>
					</view>
					<view class="youb">
						<view class="figure">+30.00</view>
						<view class="unit">USDT</view>
					</view>
				</view>
			</block>

		</view>

		<view class="footer">
			<view class="title">合作伙伴</view>
			<view class="friend_box">
				<block v-for="(item, index) in footer" :key="index">
					<view class="friend">
						<image :src='item.img' mode="heightFix"></image>
					</view>
				</block>
			</view>

			<view class="other_box">
				<block v-for="(item, index) in other" :key="index">
					<view class="other">
						<image :src='item.img' mode="heightFix"></image>
					</view>
				</block>
			</view>

			<view class="rule_box">
				<view class="rule">
					<view class="t01">生态</view>
					<view class="t02">Cex</view>
					<view class="t02">Dex</view>
					<view class="t02">加密卡</view>
					<view class="t02">L7实验室</view>
					<view class="t02">NFT</view>
				</view>
				<view class="rule"></view>
				<view class="rule">
					<view class="t01">支持</view>
					<view class="t02">项目简介</view>
					<view class="t02">符文玩法</view>
					<view class="t02">投资机构</view>
					<view class="t02">合作伙伴</view>
					
				</view>
			</view>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				urldata:'fsfsgdhfhfghfghfghgf',
				page:1,
				info:'',
				login:false,
				scroll: false,
				pupu: false,
				login: false,
				langIndex: '',
				langData: [{
						name: 'kr',
					},
					{
						name: 'en',
					},
					{
						name: 'tc',
					}
				],
				bscIndex: 1,
				bscData: [{
						name: 'BSC',
					},
					{
						name: 'BSC02',
					},
					{
						name: 'BSC03',
					}
				],

				bscText: 'BSC',
				navlist: [{
						img: '../../static/menus/menu01.png',
						name: '首頁',
						url: '/pages/index/index'
					},
					{
						img: '../../static/menus/menu02.png',
						name: '交易',
						url: '/pages/trading/trading'
					},
					{
						img: '../../static/menus/menu08.png',
						name: '閃兌',
						url: '/pages/flash/flash'
					},	
					{
						img: '../../static/menus/menu07.png',
						name: '团队',
						url: '/pages/team/team'
					},
					{
						img: '../../static/menus/menu03.png',
						name: '充幣',
						url: '/pages/filling/filling'
					},
					{
						img: '../../static/menus/menu04.png',
						name: '提幣',
						url: '/pages/mention/mention'
					},
					{
						img: '../../static/menus/menu05.png',
						name: '資產',
						url: '/pages/assets/assets'
					},
					{
						img: '../../static/menus/menu06.png',
						name: '明細',
						url: '/pages/detail/detail'
					},
				],
				footer: [{
						img: '../../static/footer/friend01.png'
					},
					{
						img: '../../static/footer/friend02.png'
					},
					{
						img: '../../static/footer/friend03.png'
					},
					{
						img: '../../static/footer/friend04.png'
					},
					{
						img: '../../static/footer/friend05.png'
					},
					{
						img: '../../static/footer/friend06.png'
					},
					{
						img: '../../static/footer/friend07.png'
					},
					{
						img: '../../static/footer/friend08.png'
					}
				],
				other: [{
						img: '../../static/footer/other01.png'
					},
					{
						img: '../../static/footer/other02.png'
					},
					{
						img: '../../static/footer/other03.png'
					},
					{
						img: '../../static/footer/other04.png'
					},
					{
						img: '../../static/footer/other05.png'
					},
					{
						img: '../../static/footer/other06.png'
					},
				]

			};
		},
		mounted() {},
		onPullDownRefresh() {},
		onLoad(e) {},
		onShow() {
			let that = this;
			//that.loadData();
		},
		methods: {
			copyMoneyUrl() {
				let that = this
				uni.setClipboardData({
					data: that.urldata,
					success: function() {
						that.Msg.Success('复制成功');
					},
					fail: function(error) {
						that.Msg.Fail('复制失败');
					}
				});
			},
			loadData() {
				let that = this;
				that.Net._get('home', {}, res => {
					if (res.code == 200) {
						//console.log(res);
			
					}
				});
			},
			choiceBsc: function(e) {
				let that = this;
				that.bscIndex = e.target.value;
				that.bscText = that.bscData[that.bscIndex].name;
				// uni.setStorageSync('_language', lang);
				// that.loadData();
			},
			choiceLang: function(e) {
				let that = this;
				that.langIndex = e.target.value;
				let lang = that.langData[that.langIndex].name;
				// uni.setStorageSync('_language', lang);
				// that.loadData();
			},
			autoListPage() {
				let that = this;
				that.pupu = !that.pupu;
			},
			autoSignin() {
				let that = this;
				that.login = !that.login;
			},
			gotopage(e) {
				var that = this;
				let url = e.currentTarget.dataset.url;
				//console.log(url);
				uni.navigateTo({
					url: url
				});
			},
			backPage() {
				uni.navigateBack({});
			}
		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 25) {
				this.scroll = true;
			} else if (Object.scrollTop < 25) {
				this.scroll = false;
			}
		},
		onReachBottom() {
			var that = this;
			that.page++;
			that.Net._get('user/coupons', {
				status: that.select,
				page: that.page,
				per_page: '10'
			}, res => {
				if (res.code == 200) {
					//console.log(res)
					if (res.data.data == '') {
						uni.showToast({
							title: '到底了~',
							duration: 2000,
							icon: 'none'
						});
					} else {
						that.info = that.info.concat(res.data.data); //将数据拼接在一起
					}
				} else if (res.code == 0) {
					that.Msg.Success(res.msg, res => {});
				}
			});
		},
	};
</script>

<style lang="scss" scoped>
	.content_box {
		width: 92%;
		margin: 0 auto;
		padding: 4vw 4%;
		background: linear-gradient(to bottom, #292929, #1B1B1B);
	}
	
	.list_box{
		background-color: #F9F9F9;
		width: 100%;
		padding: 4vw 3vw;
		margin:2vw auto 0vw;
		border-radius: 2vw;
		display: flex;
		justify-content: space-between;
		box-sizing: border-box;
	}
	.list_box .zuob{
		display: flex;
	}
	.list_box .img{
		width: 11vw;
		margin-right: 2vw;
	}
	.list_box .img image{
		width: 100%;
	}
	.list_box .name{
		color: #000;
		font-size: 4vw;
		font-weight: bold;
	}
	.list_box .time{
		color: #919191;
		font-size: 3vw;
		margin-top: 1vw;
	}
	.list_box .youb{
		text-align: right;
	}
	.list_box .figure{
		color: #F95657;
		font-size: 5vw;
	}
	.unit{
		color: #919191;
		font-size: 3vw;
	}
	
	

</style>